import request from '@/utils/request'

export function addGoods(goodsData){
  return request({
    url: '/goods/add',
    method: 'post',
    data: goodsData
  })
}

export function getPage(name,page, pageSize) {
  return request({
    url: '/goods/page',
    params:{
      name: name,
      page: page,
      pageSize: pageSize
    },
    method: 'get'
  })
}

export function getGoods(id){
  return request({
    url: '/goods/'+id,
    method: 'get'
  })
}
export function modifyGoods(goodsData){
  return request({
    url: '/goods/modify',
    method: 'post',
    data: goodsData
  })
}

export function del(ids){
  return request({
    url: '/goods?ids='+ids,
    method: 'delete'
  })
}

export function changeStatus(status,id){
  return request({
    url: '/goods/status/' + status,
    method: 'post',
    params:{
      id:id
    }
  })
}